package com.itheima.day06_demo;

public class Demo7_FindPrimeNumbers {
    public static void main(String[] args) {
        //完成找素数
        System.out.println("的素数个数为" + search(101, 200));
    }
    public static int search(int start, int end) {
      int count = 0;
      for (int i = start; i <= end; i++) {
          boolean flag = true;
          for (int j = 2; j < i; j++) {
              if (i % j == 0) {
                  flag = false;
                  break;
              }
          }
          if (flag) {
              System.out.println(i);
              count++;
          }
      }
      return count;
    }
}
